//
//  Callback.m
//  VinSwiper
//
//  Created by siloon on 5/11/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "SLCallback.h"
#import "SLDebug.h"

@implementation SLCallback

@synthesize target = _target;
@synthesize selector = _selector;

+ (SLCallback *)callbackWithTarget:(id)target selector:(SEL)selector{
	SLCallback *instance = [[SLCallback alloc] initWithTarget:target selector:selector];
	return [instance autorelease];
}

- (id)initWithTarget:(id)target selector:(SEL)selector{
	self = [self init];
    if (self) {
		InitAndDeallocLog(@"Callback init");
		self.target = target;
		self.selector = selector;
    }
    return self;
}

- (void)dealloc {
    InitAndDeallocLog(@"Callback dealloc");
	self.target = nil;
    [super dealloc];
}
@end

SLCallback * SLCallbackMake(id target, SEL selector){
	return [SLCallback callbackWithTarget:target selector:selector];
}

